import EmberObject,{computed} from '@ember/object'
import Component from '@ember/component'

export default Component.extend({
    todos:null,
    init(){
        this._super();
        this.set('todos',[
            EmberObject.create({title:'Buy food',isDone:true}),
            EmberObject.create({title:'Eat food',isDone:false}),
            EmberObject.create({title:'Catalog Tomster collection',isDone:true})
        ]);
    },

    titles: computed('todos.[]', function() {
      return this.todos.mapBy('title');
    })
})